# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-xmljson
pkgver=0.2.1
_commit=20817db7eecd057b23ed7055d32bb339c3c5a496
pkgrel=4
pkgdesc="Converts XML into JSON/Python dicts/arrays and vice-versa."
url="https://github.com/sanand0/xmljson"
license=('MIT')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-lxml')
source=("https://github.com/sanand0/xmljson/archive/$_commit/$pkgname-$_commit.tar.gz")
sha512sums=('253d3e7dd8d7bf27ded9887ad8027f542eaac9bdf06bcefcbd8ea05f3d93208a549e7cbdc3af6b756a9a5198ea0eb0b3883883a1868e4bdcdcf02fc303e623c8')

build() {
  cd xmljson-$_commit
  python setup.py build
}

check() {
  cd xmljson-$_commit
  python setup.py test
}

package() {
  cd xmljson-$_commit
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
